package com.dameng.work.controller;


import com.alibaba.fastjson.JSON;
import com.dameng.work.pojo.BRAND;
import com.dameng.work.pojo.SHELL;
import com.dameng.work.service.BRANDService;
import com.dameng.work.service.SHELLService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class BrandController {
    @Autowired
    private BRANDService bRANDService;


    @RequestMapping("/findAllBrand")
    @ResponseBody
    public String findAllBrand(){

        List<BRAND> findAllList = bRANDService.findAllList();

        Map<String, Object> returnMap = new HashMap<>();
        returnMap.put("state","1" );
        returnMap.put("result",findAllList);
        return  JSON.toJSONString(returnMap);

    }

}
